<template>
	<view class="page">
		<cu-custom bgColor="bg-system-orange">
			<block style="color: #FFFFFF;font-size: 32rpx;" slot="content">个人中心</block>
		</cu-custom>
		<view class="uinfo">
			<view class="cu-avatar xl round my-ava"
				:style="{backgroundImage: 'url(' + uimage + ')', backgroundSize:'100% 100%', backgroundRepeat: 'no-repeat'}">
				<view class="ulogininfo">
					<text class="uname">{{uname}}</text>
					<text class="uphone">{{phone}}</text>
				</view>
			</view>
		</view>
		<view class="my-about">
			<view class="k1" @click="task()">
		<image src="https://www.cetczhxf.com/mp3/task.png"></image>
				<text class="my-text">我的任务</text>
			</view>
			<view style="width: 2px;background-color: #DEDEDE;margin:40upx 0"></view>
			<view class="k1" @click="message()">
				<image src="https://www.cetczhxf.com/mp3/message.png"></image>
				<text class="my-text">消息中心</text>
			</view>
		</view>

		<view class="my-menus">
			<view class="cu-list menu">
				<view class="cu-item arrow">
					<view class="base-content" @click="goUser()">
					<image class="base-img" src="https://www.cetczhxf.com/mp3/base.png"></image>
						<text class="my-text">基本信息</text>
					</view>
				</view>
			</view>
		</view>
		<message />
	</view>
</template>

<script>
	export default {
		created() {
			let app = getApp()
			this.uimage = 'https://tva1.sinaimg.cn/large/005Tv2WXly1h0vh1wv2nvj30b40b4mx9.jpg'
			this.uname = app.globalData.getToken("name")
			this.phone = app.globalData.getToken("mobile")
		},
		data() {
			return {
				InputBottom: 0,
				uimage:'',
				uname:'',
				phone:''
			};
		},
		methods: {
			InputFocus(e) {
				this.InputBottom = e.detail.height
			},
			InputBlur(e) {
				this.InputBottom = 0
			},
			message() {
				uni.navigateTo({
					url: '/pages/notice/list'
				})
			},
			task() {
				let roleCode = uni.getStorageSync("roleCode")
				if (roleCode) {
					if (roleCode.indexOf("WB") > -1) {
						uni.navigateTo({
							url: '/wb/wbrw/wbrw'
						})
					} else if (roleCode.indexOf("JC") > -1) {
						uni.navigateTo({
							url: '/jcqy/jcrw/jcrw'
						})
					} else if (roleCode.indexOf("XZ") > -1) {
						uni.navigateTo({
							url: '/yzqy/rwlb/rwlb'
						})
					} else if (roleCode.indexOf("XT") > -1 || roleCode.indexOf("DD") > -1  || roleCode.indexOf("ZD") > -1) {
						uni.navigateTo({
							url: '/jgbm/jcrw/jcrw'
						})
					} else {
						uni.showToast({
							title: "无权限！",
							icon: 'error'
						})
					}
				
				} else {
					uni.showModal({
						title: "无权限",
						showCancel: false
					})
				}
			},
			goUser() {
				uni.navigateTo({
					url: '/pages/my/userInfo'
				})
			}
		}
	}
</script>

<style scoped>
	.page {
		height: 100vh;
	}
.my-text {
	color: #333;
	font-size:14px;
}
	.uinfo {
		height: 300upx;
		width: 100%;
		background-image: linear-gradient(215deg, #FFCC73 10%, #FCAA19 90%);
		border-radius: 100% 100% 100% 100% / 0% 0% 40% 40%;

	}

	.my-ava {
		width: 150upx;
		height: 150upx;
		margin: 49upx 70upx;
		border: 5px solid white;
		position: relative;
	}

	.ulogininfo {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		position: absolute;
		left: 150upx;
	}

	.uname {
		font-family: PingFangSC-Medium;
		font-size: 40upx;
		color: #FFFFFF;
		letter-spacing: 0;
	}

	.uphone {
		opacity: 0.58;
		font-family: PingFangSC-Regular;
		font-size: 24upx;
		color: #FFFFFF;
		letter-spacing: 0;
		margin-top: 24upx;
	}

	.my-about {
		height: 200upx;
		margin: -60upx 24upx 0 24upx;
		border-radius: 8px;
		background-color: #FFFFFF;
		display: flex;
		flex-direction: row;
		justify-content: space-around;

	}

	.k1 {
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.my-about image {
		height: 70upx;
		width: 80upx;
	}

	.my-about text {
		font-size: 24upx;
		color: #333333;
		line-height: 40upx;
		margin-top: 18upx;
	}

	.my-menus {
		margin-top: 42upx;
	}

	.base-content {
		height: 140upx;
		line-height: 140upx;
		vertical-align: middle;
		padding: 0 20upx;
	}
	.base-img {
		height: 70upx;
		width: 80upx;
		vertical-align: middle;
		margin-right: 15px;
	}
</style>
